#include<iostream>
#include<format>
#include<string>
#include<algorithm>
using namespace std;
string change(int n,int p=10){
  string store;
  while(n){
    int item=n%p;
    store+=item<10?item+'0':item-10+'A';
    n/=p;
  }
  reverse(store.begin(),store.end());
  return store;
}
int main(){
  int p;
  cin>>p;
  for(int i=1;i<p;i++){
    for(int j=1;j<=i;j++){
      cout<<format("{}*{}={} ",change(i,p),change(j,p),change(i*j,p));
    }
    cout<<endl;
  }
}